//
//  MeModelGroup.m
//  YSSmartHome
//
//  Created by yanghao on 2016/10/8.
//  Copyright © 2016年 yahaong. All rights reserved.
//

#import "MeModelGroup.h"
#import "MeModel.h"
@implementation MeModelGroup

+ (NSArray *)loadData
{
    NSString *path  =  [[NSBundle mainBundle] pathForResource:@"me" ofType:@"plist"];
    NSDictionary *dict =  [NSDictionary dictionaryWithContentsOfFile:path];
    NSMutableArray *datas = [NSMutableArray array];
    NSArray *array1 = dict[@"data1"];
    NSMutableArray *group1 = [NSMutableArray arrayWithCapacity:array1.count];
    for (NSDictionary *dict in array1) {
        [group1 addObject:[MeModel meModelWithDict:dict]];
    }
    MeModelGroup *meModelGroup1 = [[MeModelGroup alloc]init];
    meModelGroup1.groups = [group1 copy];
    [datas addObject:meModelGroup1];
    NSArray *array2 = dict[@"data2"];
    NSMutableArray *group2 = [NSMutableArray arrayWithCapacity:array1.count];
    for (NSDictionary *dict in array2) {
        [group2 addObject:[MeModel meModelWithDict:dict]];
    }
    MeModelGroup *meModelGroup2 = [[MeModelGroup alloc]init];
    meModelGroup2.groups = [group2 copy];
    [datas addObject:meModelGroup2 ];
    return datas.copy;

}
    
    
    


@end
